package com.zf.yichat.vo;

/**
 * 一句话描述功能
 *
 * @author fengsong
 * @date create in 16:45 2019/6/10 2019
 */
public enum IntegralType {

    //0签到  2分享到微信好友 3 分享到微信朋友前 4分享到qq好友 5分享qq空间
    SIGN(0, "签到"),
    INVITE(1, "邀请"),
    SHARE_WX_FRIENDS(2, "分享微信好友"),
    SHARE_WX_AROUND(3, "分享微信朋友圈"),
    SHARE_QQ_FREIND(4, "分享QQ好友"),
    SHARE_QQ_AROUND(5, "分享QQ空间"),
    PAY_ADD(6, "充值"),
    MANGHE_CONSUME(7, "积分兑换成商品"),
    MANGHE_ADD(8, "商品兑换成积分"),
    GAME_ADD(9, "玩游戏赠送积分"),
    LOTTERY_CONSUME(10, "抽奖消耗积分"),
    REGISTER_CONSUME(11, "注册赠送积分"),
    REAL_NAME_CONSUME(12, "实名认证赠送积分"),
    BIND_CARD_CONSUME(13, "绑卡赠送积分"),
    ANSWER_QUESTION(14, "用户答题赠送能量"),
    PLANT_TREE(15, "浇树赠送能量"),
    INTEGRAL_EXCHANGE_BALANCE(16, "用户能量兑换余额")
    ;

    IntegralType(Integer val, String desc) {
        this.val = val;
        this.desc = desc;
    }

    private int val;
    private String desc;

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public int getVal() {
        return val;
    }

    public void setVal(int val) {
        this.val = val;
    }

    public static IntegralType valOf(Integer type) {
        for (IntegralType t : IntegralType.values()) {

            if (t.getVal() == type) {
                return t;
            }
        }

        return null;
    }
}
